package org.budo.daman.redis;

import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;

import redis.clients.jedis.Jedis;

/**
 * @author lmw
 */
public class BudoDamanRedis {
    public static void main(String[] args) {
        String host = "r-bp1d3853797949c4799.redis.rds.aliyuncs.com";
        int port = 6379;
        Jedis jedis = new Jedis(host, port);
        jedis.auth("");
        jedis.select(12);
        Set<String> set = jedis.keys("WARNING:SETTING:REDIS_KEY_WARNING_CUSTOM_SETTINGS*");
        for (String key : set) {
            String type = jedis.type(key);
            System.err.println(key + " > " + type);
        }

        Map<String, String> map = jedis.hgetAll("WARNING:SETTING:REDIS_KEY_WARNING_CUSTOM_SETTINGS");
        Set<Entry<String, String>> entrySet = map.entrySet();
        for (Entry<String, String> entry : entrySet) {
            System.err.println(entry.getKey() + " > " + entry.getValue());
        }

        jedis.close();
    }
}